package com.ruoyi.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.DTO.CourseDetailDTO;
import com.ruoyi.domain.DTO.CourseWithVideoVO;
import com.ruoyi.mapper.CourseMapper;
//import com.ruoyi.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/course/detail")
public class CourseAndVideoController {

    @Autowired
    private CourseMapper courseMapper;

// 修改后无需参数

    @GetMapping("/with-videos")
    public ResponseEntity<List<CourseWithVideoVO>> getCourseWithVideos() {
        List<CourseWithVideoVO> result = courseMapper.selectCourseWithVideos();
        return ResponseEntity.ok(result);
    }
}


